package com.accp.util;

import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

@SuppressWarnings("serial")
public class MyInterceptor extends MethodFilterInterceptor {

	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		Map<String, Object> session = ServletActionContext.getContext().getSession();
		if(null == session){
			ServletActionContext.getResponse().sendRedirect("/login.jsp");
		}
		return invocation.invoke();
	}

}
